<?
require("config.php");

$location_status .= " | Edit";

$show_backnav = "customer_menu";

require($rela_path . "bin/country.php");

$menutype = 2;

if (NULL!=$action){

   $field = array(
	"username",
	"password",
		"firstname",
		"lastname",
		"age",
	"address",
	"zip",
	"city",
	"country",
	"tel",
	"fax",
	"email",
	"website",
		"profession",
		"education",
		"cardname",
	   "cardtype",
	   "cardno",
	   "expiration_date",
	   "registration_date",
	   "status",
	   "enrollment_date",
	"ccs_followed",
	);


   $content = array(
	$Username,
	$Password,
		$Firstname,
		$Lastname,
	    $Age,
	$Address,
	$Zip,
	$City,
	$Country,
	$Tel,
	$Fax,
	$Email,
	$Website,
		$Profession,
		$Education,
	    $Cardname,
	    $Cardtype,
	    $Cardno,
	    "$myYear-$myMonth-$myDay",
	   "$Year1-$Month1-$Day1",
	    $Status,
	    "$Year-$Month-$Day",
	$Followed,
	);

   $exp = "id='$id'";

   myUpdate($table,$field,$content,$exp);


   header("location:" . $rela_path . "share/msg.php?v=23&Start_Num=" . $Start_Num);

   exit();

}


$Query = "select 
	code,
	username,
	password,
		firstname,
		lastname,
		age,
	address,
	zip,
	city,
	country,
	tel,
	fax,
	email,
	website,
		profession,
		education,
		cardname,
	   cardtype,
	   cardno,
	   expiration_date,
	   status,
	   registration_date,
	   enrollment_date,
	ccs_followed  
from $table where id='$id' Limit 1";
$r = myQuery($Query);

	$Code=		$r[0][0];
	$Username=$r[0][1];
	$Password=$r[0][2];
		$Firstname=$r[0][3];
		$Lastname=$r[0][4];
	    $Age=$r[0][5];
	$Address=$r[0][6];
	$Zip=$r[0][7];
	$City=$r[0][8];
	$Country=$r[0][9];
	$Tel=$r[0][10];
	$Fax=$r[0][11];
	$Email=$r[0][12];
	$Website=$r[0][13];
		$Profession=$r[0][14];
		$Education=$r[0][15];
	    $Cardname=$r[0][16];
	    $Cardtype=$r[0][17];
	    $Cardno=$r[0][18];
	    $Expiration_date=$r[0][19];
	    $Status=$r[0][20];
		$Registration_date=$r[0][21];
	    $Enrollment_date=$r[0][22];
	$Followed=$r[0][22];

require($rela_path . "inc/header.php");

?>

<form action="" method="post" name="form1">  

<!--hidden filed-->
<input name="action" type="hidden" value="edit">
<input name="id" type="hidden" value="<?print($id)?>">
<input name="Start_Num" type="hidden" value="<?print($Start_Num)?>">
<input name="Code" type="hidden" value="<?print($Code)?>">




<table width="95%" border="0" align="center">
  <tr> 
    <td align="right">
	
	<input type="image" src="../../images/bt_cancel.gif" width="78" height="23" onclick="Redirect('customer_menu.php',1);return false;"> 
	<input type="image" src="../../images/bt_save.gif" width="76" height="22"> 


    </td>
  </tr>
</table>
<table width="95%" border="0" align="center">
  <tr>
    <td valign="top">&nbsp;</td>
  </tr>
  <tr> 
    <td valign="top"> <div align="right"> </div>
      <table border="0">
        <tr> 
          <td class="tdheader">Code :</td>
          <td> <?print($Code)?>
              </td>
        </tr>
        <tr> 
          <td class="tdheader">Username :</td>
          <td> <input type="text" class="text" name="Username" value="<?print($Username)?>"> </td>
        </tr>
        <tr> 
          <td class="tdheader">Password :</td>
          <td> <input type="text" class="text" name="Password" value="<?print($Password)?>"> </td>
        </tr>

        <tr> 
          <td height="3" class="tdheader">First Name :</td>
          <td height="3"> <input type="text" class="text" name="Firstname" size="35" value="<?echo $Firstname?>">
              <font color="red">&nbsp;</font> <b></b></td>
        </tr>


        <tr> 
          <td height="3" class="tdheader">Last Name :</td>
          <td height="3"> <input type="text" class="text" name="Lastname" size="35" value="<?echo $Lastname?>">
              <font color="red">&nbsp;</font> <b></b></td>
        </tr>


        <tr> 
          <td height="3" class="tdheader">Age :</td>
          <td height="3"> <input type="text" class="text" name="Age" value="<?echo $Age?>">
              <font color="red">&nbsp;</font> <b></b></td>
        </tr>
        <tr> 
          <td class="tdheader">Address :</td>
          <td> <textarea class="text" name="Address" cols="40" rows="5"><?print($Address)?></textarea> 
          </td>
        </tr>
        <tr> 
          <td class="tdheader">Zip Code :</td>
          <td> <input type="text" class="text" name="Zip" size="55" value="<?print($Zip)?>"> 
          </td>
        </tr>
        <tr> 
          <td height="25" class="tdheader">City :</td>
          <td height="25"> <input type="text" class="text" name="City" size="55" value="<?print($City)?>"> 
          </td>
        </tr>
        <tr> 
          <td class="tdheader">Country : </td>
            <td> <?print(FFPCountry($Country))?> </td>
        </tr>

		<tr> 
          <td class="tdheader">Tel :</td>
          <td> <input type="text" class="text" name="Tel" size="55" value="<?print($Tel)?>"> 
          </td>
        </tr>
        <tr> 
          <td class="tdheader">Fax :</td>
          <td> <input type="text" class="text" name="Fax" size="55" value="<?print($Fax)?>"> 
          </td>
        </tr>
        <tr> 
          <td class="tdheader">Email :</td>
          <td> <input type="text" class="text" name="Email" size="55" value="<?print($Email)?>"> 
          </td>
        </tr>
        <tr> 
          <td class="tdheader">Website :</td>
          <td> <input type="text" class="text" name="Website" size="55" value="<?print($Website)?>"> 
          </td>
        </tr>
        <tr> 
          <td class="tdheader">Profession :</td>
          <td> <input type="text" class="text" name="Profession" size="55" value="<?=$Profession?>"> 
          </td>
        </tr>
        <tr> 
          <td class="tdheader">Education :</td>
          <td> <textarea class="text" name="Education" cols="40" rows="5"><?=$Education?></textarea> 
          </td>
        </tr>
        <tr> 
          <td class="tdheader">Credit Card Name :</td>
          <td> <input type="text" class="text" name="Cardname" size="55" value="<?=$Cardname?>"> 
          </td>
        </tr>

        <tr> 
          <td class="tdheader">Credit Card Type :</td>
          <td> 
		  
<?

$sourceData = array(
  "Visa",
  "American Express",
  "Master",
  );

FFPSelectBox("Cardtype",$Cardtype,$sourceData,$sourceLabel);

?>		  
		  
		  
          </td>
        </tr>

        <tr> 
          <td class="tdheader">Credit Card No. :</td>
          <td> <input type="text" class="text" name="Cardno" size="55" value="<?=$Cardno?>">  
          </td>
        </tr>

        <tr> 
          <td class="tdheader">Expiration Date :</td>
          <td> <?print(FFPtime($Expiration_date))?>
          </td>
        </tr>



        <tr> 
          <td class="tdheader">Status :</td>
          <td> 
		  
<?

$sourceData = array(
  "Activate",
  "Member",
  "Graduate",
  );

FFPSelectBox("Status",$Status,$sourceData,$sourceLabel);

?>		  
		  
		  
          </td>
        </tr>



        <tr> 
          <td class="tdheader">Member Registration Date :</td>
          <td> 
		  
<?



print FFPdate1($Registration_date)?>	  
		  
		  
          </td>
        </tr>





        <tr> 
          <td class="tdheader">Latest Enrollment Date :</td>
          <td> 
		  
<?print(FFPdate($Enrollment_date))?>	  
		  
		  
          </td>
        </tr>




<?

$Query = "select name from user_profile where type='1' or type='0'";
$r = myQuery($Query);

?>

        <tr> 
          <td class="tdheader">Followed by :</td>
          <td>
		  	  
		  <select class="select" name="Followed">
              <option value="">SELECT</option>
			  <?for ($i=0;$i<count($r);$i++){
				  if ($r[0][$i]==$Followed) $active="SELECTED"?>
              <option value="<?echo $r[$i][0]?>" <?echo $active?>><?echo $r[$i][0]?></option>
			  <?$active="";
			  }?>
            </select>
			
			</td>
        </tr>
      </table></td>
  </tr>
</table>
<table width="95%" border="0" align="center">
  <tr> 
    <td align="right">
	
	
	<input type="image" src="../../images/bt_cancel.gif" width="78" height="23" onclick="Redirect('customer_menu.php',1);return false;"> 
	<input type="image" src="../../images/bt_save.gif" width="76" height="22"> 




    </td>
  </tr>
</table>
</form>
<br>
<br>
<br>
<?
require($rela_path . "inc/footer.php");
?>
